package com.class04.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassDescription:
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2023/12/1 14:20
 */
@Controller
public class HelloController {
//    handler ->springmvc/hello   return "hello world";
//    对外访问的地址  到handlerMapping注册的注解
    @RequestMapping("springmvc/hello")
    @ResponseBody//直接返回字符串给前端，不要视图解析器
    public String hello(){
//        返回给前端
        return "hello world";
    }
}
